﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Altairis.Web.Management.Configuration {
    public class ErrorPagesElement : ConfigurationElement {

        [ConfigurationProperty("enabled", IsRequired = false, DefaultValue = false)]
        public bool Enabled {
            get { return (bool)this["enabled"]; }
            set { this["enabled"] = value; }
        }

        [ConfigurationProperty("folderName", IsRequired = false, DefaultValue = "~/App_Data/ErrorPages/")]
        public string FolderName {
            get { return (string)this["folderName"]; }
            set { this["folderName"] = value; }
        }

        [ConfigurationProperty("excludeLocalRequests", IsRequired = false, DefaultValue = true)]
        public bool ExcludeLocalRequests {
            get { return (bool)this["excludeLocalRequests"]; }
            set { this["excludeLocalRequests"] = value; }
        }

        [ConfigurationProperty("fallbackErrorCode", IsRequired = false, DefaultValue = 500)]
        [IntegerValidator(MinValue = 400, MaxValue = 599)]
        public int FallbackErrorCode {
            get { return (int)this["fallbackErrorCode"]; }
            set { this["fallbackErrorCode"] = value; }
        }

    }
}
